//
// Created by Jisam on 23/10/2024 22:08.
// Solution of  template
#include <bits/stdc++.h>

#define  int long long
#define  endl "\n"
#define  all(x) (x).begin(),(x).end()
#define  pb push_back
using namespace std;
int f[105][10010];
signed main() {
    cin.tie(nullptr)->sync_with_stdio(false);
    int n,m;
    cin >> n >> m;
    vector<int> a(n + 10);
    for(int i = 1; i <= n ; i ++) cin >> a[i];

    f[0][0] = 1;
    for(int i = 1; i <= n; i ++){
        for(int j = 0; j <= m;j ++)
        {
            f[i][j] = f[i - 1][j];
            if(j >= a[i]) f[i][j] += f[i - 1][j - a[i]];
        }
    }
    cout << f[n][m];
    return 0;
}